/////precompiled////////
#include "precompiled.h"
////////////////////////


#include "prs_FrmScinPanel.h"
using namespace prs;

// TNodeFrmScinPanel
//
TNodeFrmScinPanel::TNodeFrmScinPanel()
: NodeType(this)
, Control(this)
, EnEdit(this)
, Value(this)
, CaretWidth(this)
, UseGlobalKeywords(this)
{
	EnEdit.SetValue(true);
	Value.SetValue("");
	CaretWidth.SetValue(1);
	UseGlobalKeywords.SetValue(false);
}



// TRuleFrmScinPanel //////////////////////////////////////////////////////////////

//
TRuleFrmScinPanel::TRuleFrmScinPanel(
  snt::text::TContext &Context,
  svl::TVariant &VParentNode,
  TRuleFrmChildrenBase &RChildren,
  TRuleSetNodeIdOptionally &RSetNodeIdOptionally,
  TRuleFrmGeom &RFrmGeom,
  TRuleSetAttrValue &RSetAttrValue,
  TRuleSetStyle &RStyle
) 
:vParentNode(VParentNode)
,rGeometry(RFrmGeom)
{
  snt::text::TSequence T(Context);
  snt::text::TKeyword K(Context);
  snt::TFVoid F;
  TFuncNewNodeIntoAttrOldChildren FNewNode;
  snt::TReturn Return;

  this->Name(GetClassName()).Local(vParentNode)
  | K.New("scin") & FNewNode.New(vParentNode,TNodeFrmScinPanel()) 
    & RSetNodeIdOptionally.New() & RAttr.New() 
    & Return.New()
  ;
  
  RAttr
  | T.New("(") 
    & RAttr1.New() 
    & T.New(")") & Return.New()
  | Return.New()
  ;

  RAttr1
  | AAttr1.New()
  ;
  AAttr1
  | RSetAttrValue.New(
      VParentNode,
      TRuleSetAttrValue::TAttrs()
	     .Add(prs::TFrmDict::attrName_Value,     this,&TRuleFrmScinPanel::FSetParamS)
		   .Add(prs::TFrmDict::attrName_CaretWidth,this,&TRuleFrmScinPanel::FSetParamI)
		   .Add(prs::TFrmDict::attrName_EnEdit,    this,&TRuleFrmScinPanel::FSetParamB)
	  )
    & AAttr1.New()
  | RStyle.New() & AAttr1.New()
  | F.New(this,&TRuleFrmScinPanel::FSetGeometry) & RFrmGeom.New() & AAttr1.New()
  | Return.New()
  ;
}
